package com.wxp.alice.lanfilemaster.Server;

import com.wxp.alice.lanfilemaster.Server.Base.BaseHttpServer;
import com.wxp.alice.lanfilemaster.Server.Base.BaseRequestHandler;

class IndexHandler extends BaseRequestHandler {
    @Override
    protected void get() {
        write("index");
    }
}

class UploadHandler extends BaseRequestHandler {
    @Override
    public void get() {
        write("Uploading");
    }
}

public class HttpServer extends BaseHttpServer {

    public HttpServer(int port) {
        super(port);
        init();
    }

    public HttpServer(String hostname, int port) {
        super(hostname, port);
        init();
    }

    private void init() {
        addRoute("/", new IndexHandler());
        addRoute("/upload", new UploadHandler());
    }
}
